/**
 * 
 */
var btnList, btnInput, btnModify, btnDelete;
var url = 'index.jsp?inc=./member/';

function general() {
	btnList = document.getElementById('btnList');
	if (btnList != null) {
		btnList.onclick = function() {
			location.href = url + 'list.jsp';
		}
	}
	btnInput = document.getElementById('btnInput');
	if (btnInput != null) {
		btnInput.onclick = function() {
			location.href = url + 'input.jsp';
		}
	}
	btnModify = document.getElementById('btnModify')
	if (btnModify != null) {
		btnModify.onclick = function() {
			var b = confirm("정말 수정");
			if(b){
				var f = document.hiddenfrm;
				f.action = url+'modify.jsp';
				f.submit();
				
			}else{
				alert("삭제취소");
			}
		}
	}
	
	btnDelete = document.getElementById('btnDelete');
	if (btnDelete != null) {
		btnDelete.onclick = function() {
			var b = confirm("정말 삭제");
			if(b){
				var f = document.hiddenfrm;
				f.action = url+'delete_result.jsp';
				f.submit();
			}else{
				alert("삭제취소");
			}
		}
	}
	btnView = document.getElementById('btnView');
	if (btnView != null) {
		btnView.onclick = function() {
			var f = document.hiddenfrm;
			f.action = url + 'view.jsp';
			f.submit();
		}
	}
}

function goPage(page) {
//	 location.href = url + 'list.jsp&nowPage=' + page;
//	 alert(page);
	
	var mf = document.hidfrm;
	mf.nowPage.value = page;
	mf.find.value = document.member_list_frm.find.value;
	mf.action = 'index.jsp?inc=./member/list.jsp';
	
	mf.submit();
}

function goView(page, mid) {
	alert();
	var kk = document.hidfrm;
	kk.nowPage.value = page;
	kk.mid.value = mid;
	kk.action = 'index.jsp?inc=./member/view.jsp';
	
	kk.submit();
}

function inputInit() {
	alert();
	general();
	document.getElementById("btnSave").onclick = function() {
		var f = document.ff;
		if (f.mid.value == "") {
			alert("아이디를 입력하세요");
			f.mid.focus();
		} else {
			f.submit();
		}
	}
}
function modifyInit() {
	general();
	document.getElementById('btnSave').onclick = function() {
		alert();
		var ff = document.ffrm;
		if (ff.mid.value == "") {
			alert("아이디를 입력하세요");
			ff.mid.focus();
		} else {
			ff.submit();
		}
	}
}
function deleteInit() {
	general();
}
function viewInit() {
	general();
	
}
function listInit() {
	general();
}


